import { transformRecordToOption } from '@/utils/common';
import { Api } from '@/typings/api';
export const enableStatusRecord: Record<Api.Common.EnableStatus, App.I18n.I18nKey> = {
  '1': 'page.manage.common.status.enable',
  '2': 'page.manage.common.status.disable'
};

export const enableStatusOptions = transformRecordToOption(enableStatusRecord);

export const userGenderRecord: Record<Api.SystemManage.UserGender, App.I18n.I18nKey> = {
  '1': 'page.manage.user.gender.male',
  '0': 'page.manage.user.gender.female'
};

export const userGenderOptions = transformRecordToOption(userGenderRecord);

export const menuTypeRecord: Record<Api.SystemManage.MenuType, App.I18n.I18nKey> = {
  '1': 'page.manage.menu.type.directory',
  '2': 'page.manage.menu.type.menu'
};

export const menuTypeOptions = transformRecordToOption(menuTypeRecord);

export const menuIconTypeRecord: Record<Api.SystemManage.IconType, App.I18n.I18nKey> = {
  '1': 'page.manage.menu.iconType.iconify',
  '2': 'page.manage.menu.iconType.local'
};

export const menuIconTypeOptions = transformRecordToOption(menuIconTypeRecord);

export const yesOrNoRecord: Record<Api.User.yesOrNo, App.I18n.I18nKey> = {
  '1': 'page.common.yesOrNo.yes',
  '0': 'page.common.yesOrNo.no',
};


export const roleStatusRecord: Record<Api.User.roleStatus, App.I18n.I18nKey> = {
  'user': 'page.common.role.user',
  'admin': 'page.common.role.admin',
  'super': 'page.common.role.superAdmin',
  'enterprise': 'page.common.role.enterprise',
};
export const generateStatusRecord: Record<Api.User.generateStatus, App.I18n.I18nKey> = {
  'pending': 'page.common.generateStatus.pending',
  'processing': 'page.common.generateStatus.processing',
  'generated': 'page.common.generateStatus.generated',
  'failed': 'page.common.generateStatus.failed',
  'lora-awaiting': `page.common.generateStatus.${'lora-awaiting'}`,
  'lora-pending': `page.common.generateStatus.${'lora-pending'}`,
  'lora-failed': `page.common.generateStatus.${'lora-failed'}`,
  'lora-success': `page.common.generateStatus.${'lora-success'}`,
};

export const fromStatusRecord: Record<Api.User.fromStatus, App.I18n.I18nKey> = {
  'upload': 'page.common.fromStatus.upload',
  'community': 'page.common.fromStatus.community',
  'market': 'page.common.fromStatus.market',
  'library': 'page.common.fromStatus.library',
};

export const operationStatusRecord: Record<Api.User.operationStatus, App.I18n.I18nKey> = {
  'add': 'page.common.operationStatus.add',
  'update': 'page.common.operationStatus.update',
  'delete': 'page.common.operationStatus.delete',
  'select': 'page.common.operationStatus.select',
  'login': 'page.common.operationStatus.login',
};

export const marketStatusRecord: Record<Api.User.marketStatus, App.I18n.I18nKey> = {
  'published': 'page.common.marketStatus.published',
  'pending': 'page.common.marketStatus.pending',
  'rejected': 'page.common.marketStatus.rejected',
};

export const roleStatusOptions = transformRecordToOption(roleStatusRecord);
